home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGMISC
/
FORTRAN2.LZH
/
WEKDAY.FOR
< prev
next >
Wrap
Text File
|
1988-02-08
|
2KB
|
89 lines
SUBROUTINE WEKDAY ( TIME, DAY )
C*
C* *******************************
C* *******************************
C* ** **
C* ** WEKDAY **
C* ** **
C* *******************************
C* *******************************
C*
C* SUBPROGRAM :
C* WEEKDAY
C*
C* AUTHOR :
C* ART RAGOSTA
C* MS 207-5
C* AMES RESEARCH CENTER
C* MOFFETT FIELD. CALIF 94035
C* (415)694-5578
C*
C* PURPOSE :
C* TO CALCULATE THE DAY OF THE WEEK('SUNDAY', 'MONDAY'...) FROM
C*
C* METHODOLOGY :
C* USE BUILT-IN SYSTEM SERVICES.
C*
C* INPUT ARGUMENTS :
C* TIME - THE DATE IN QUESTION (EG,'21-JAN-1985 12:00:00.00').
C*
C* OUTPUT ARGUMENTS :
C* DAY - THE DAY OF THE WEEK (EG, 'MONDAY' ).
C*
C* INTERNAL WORK AREAS :
C* NONE
C*
C* COMMON BLOCKS :
C* NONE
C*
C* FILE REFERENCES :
C* NONE
C*
C* DATA BASE ACCESS :
C* NONE
C*
C* SUBPROGRAM REFERENCES :
C* SYS$BINTIM, LIB$DAY
C*
C* ERROR PROCESSING :
C* NONE
C*
C* TRANSPORTABILITY LIMITATIONS :
C* EVERYTHING
C*
C* ASSUMPTIONS AND RESTRICTIONS :
C* NONE
C*
C* LANGUAGE AND COMPILER :
C* DEC FORTRAN 77
C*
C* VERSION AND DATE :
C* VERSION I.0 25-JAN-85
C*
C* CHANGE HISTORY :
C* 25-JAN-85 INITIAL VERSION
C*
C***********************************************************************
C*
CHARACTER*23 TIME
CHARACTER*9 DAYS(0:6), DAY
DATA DAYS / 'WEDNESDAY', 'THURSDAY ', 'FRIDAY ', 'SATURDAY ',
$ 'SUNDAY ', 'MONDAY ', 'TUESDAY '/
INTEGER ITIME(2)
C
DAY = 'ERROR '
I = SYS$BINTIM(TIME,ITIME)
IF (ABS(I) .GT. 1) RETURN
I = LIB$DAY(NDAYS,ITIME)
IF (ABS(I) .GT. 1) RETURN
C
C --- NDAYS IS THE NUMBER OF DAYS SINCE SYSTEM TIME 0.
C
I = MOD(NDAYS,7)
DAY = DAYS(I)
RETURN
END
C
C---END WEKDAY
C